# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-libvmdk-python
pkgname=('libvmdk-python' 'python2-libvmdk-python' 'python-libvmdk-python')
_pkgname=libvmdk-python
pkgver=20191221
pkgrel=4
pkgdesc='Library and tools to access the VMware Virtual Disk (VMDK) format.'
url='https://github.com/libyal/libvmdk'
arch=('x86_64' 'aarch64')
license=('LGPLv3')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2a35fd14e6a500b8f3f616be15026db1f61d759ea0ae77cd17bf5813e0352116a16e5189ae5e42a0f9ba9818954c00fdc1404c312e6fdb9cd37f6a7ddb504961')

build() {
  cd "libvmdk-$pkgver"

  ./configure --prefix=/usr
  make
}

package_libvmdk-python() {
  cd "libvmdk-$pkgver"

  make DESTDIR="$pkgdir" install
}

package_python2-libvmdk-python() {
  depends=('python2')

  cd "libvmdk-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1
}

package_python-libvmdk-python() {
  depends=('python')

  cd "libvmdk-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1
}

